using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter19
{
	/// <summary>
	/// Example04: The Thermal Electric Short
	/// An electronic device has been poorly designed so that two
	/// bolts attached to different parts of the device almost
	/// touch each other in its interior. The steel and brass bolts
	/// are at different electric potentials and if they touch, 
	/// a short circuit will develop, damaging the device. (We
	/// will study electric potential in Chapter 25.) If the initial
	/// gap between the ends of the bolts is 50 \mu m at 27 C, at
	/// which temperature will the bolts touch?
	/// T = 34 C
	/// </summary>
	public class Example04
	{
		public Example04()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			// delL = alpha*L*delT
            L.Temperature t1 = new L.Temperature();
			t1.C = 27.0;
			L.Temperature t2 = new L.Temperature();
		
			double alpha1 = 19.0E-6;
			double alpha2 = 11.0E-6;
			L.Length oriL1 = new L.Length();
			oriL1.m = 0.03;
			L.Length oriL2 = new L.Length();
			oriL2.m = 0.01;

			L.Length delL = new L.Length();
			delL.m = 5.0E-6;
			
			t2.C = delL.m/(alpha1*oriL1.m+alpha2*oriL2.m)+t1.C;
			result+=Convert.ToString(t2.C);
		}
	}
}
